<template>
	<view class="page_box">
		<scroll-view scroll-y="true" class="scroll-box">
			<view v-for="(item, index) in noticeList" :key="index" class="notice-layout">
				<navigator class="notice-box" :url="'/pages/home/goodsDetail/noticeDetail?id=' + item.id">
					<view class="notice-title">{{item.title}}</view>
					<view class="notice-more">
						<view>{{item.updateTime}}</view>
						<view class="see">查看》</view>
					</view>
				</navigator>
			</view>
		</scroll-view>
	</view>
</template>

<script>
	export default {
		components: {

		},
		data() {
			return {
				noticeList: [],
			};
		},
		onLoad(opt) {
			this.init();
		},
		methods: {
			init() {
				this.$api.getNotice({
					type: 1
				}).then(res => {
					if (res.ok&&res.data.length>0) {
						this.noticeList = res.data
					}
				});
			},
		}
	};
</script>

<style lang="scss" scoped>
	@font-face {
		font-family: 'iconfont';
		/* project id 1796157 */
		src: url('//at.alicdn.com/t/font_1796157_616mg8112mu.eot');
		src: url('//at.alicdn.com/t/font_1796157_616mg8112mu.eot?#iefix') format('embedded-opentype'), url('//at.alicdn.com/t/font_1796157_616mg8112mu.woff2') format('woff2'),
			url('//at.alicdn.com/t/font_1796157_616mg8112mu.woff') format('woff'), url('//at.alicdn.com/t/font_1796157_616mg8112mu.ttf') format('truetype'),
			url('//at.alicdn.com/t/font_1796157_616mg8112mu.svg#iconfont') format('svg');
	}

	/* #ifdef MP-TOUTIAO */
	@font-face {
		font-family: uniicons;
		font-weight: normal;
		font-style: normal;
		src: url('~@/static/uni.ttf') format('truetype');
	}

	/* #endif */
	.notice-layout {
		height: 152rpx;
		    // border: 1px solid #ccc;
		    margin: 24rpx 24rpx 12rpx;
		    background: #fff;
		    border-radius: 4px;
	}

	.notice-box {
		    padding: 4rpx 8rpx;
		display: flex;
		flex-direction: column;
		height: 100%;
	}

	.notice-title {
		height: 50%;
		display: flex;
		align-items: center;
		height: 50%;

	}

	.notice-more {
		display: flex;
		height: 50%;
		align-items: center;
		height: 50%;
	}
	.see{
		position: absolute;
		right: 24rpx;
		color:#00aaff;
	}
</style>
